package com.veryUsedCar.api.fallback;

import com.veryUsedCar.api.UserServiceApi;
import com.veryUsedCar.data.Result;
import com.veryUsedCar.dto.UserDTO;
import com.veryUsedCar.enums.ConstantEnum;
import org.springframework.stereotype.Component;

// 1.实现feign接口, 重写所以方法 2.实例化降级类
@Component
public class UserServiceApiFallback implements UserServiceApi {
    @Override
    public Result<UserDTO> findUserById(Long userId) {
        return Result.build(ConstantEnum.FLOWLIMITING);
    }

    @Override
    public Result<UserDTO> findUserByName(String uname) {
        return Result.build(ConstantEnum.FLOWLIMITING);
    }
}
